home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 37 / 037.d81 / total control (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  82 lines

  1. 10 gosub60100:clr:goto100
  2. 19 :
  3. 20 :   ************************
  4. 21 :   *                      *
  5. 22 :   * input subroutine is  *
  6. 25 :   *     lines 40-59      *
  7. 26 :   *                      *
  8. 27 :   ************************
  9. 29 :
  10. 40 poke198,0:print"[[166]";:forx=1tole:print" ";:next:print"]":print"[145]";
  11. 41 c$="":fora=1tole+1
  12. 42 geta$:ifa$=""then42
  13. 44 ifa$=chr$(13)then59
  14. 46 ifa$=chr$(20)anda>1thenprint"[157][157]  [157][157][166]";:a=a-1:c$=left$(b$,a-1):goto42
  15. 48 ifa=le+1then42
  16. 50 if(nu)thenifa$>="0"anda$<="9"then58
  17. 51 if(nu)thenifa$="."ora$="-"then58
  18. 52 if(al)and((a$>=" "anda$<="/")or(a$>=":"anda$<="z"))then58
  19. 54 if(al)thenif(a$>="[193]"anda$<="[218]")then58
  20. 56 goto42
  21. 58 print"[157]"a$;:poke212,.:print"[166]";:c$=c$+a$:next
  22. 59 print"[157] ":return
  23. 62 :
  24. 63 :   * demo for subroutine *
  25. 64 :
  26. 100 poke53280,.:poke53281,.:print"[147]             [158][212]otal [195]ontrol"
  27. 110 print"           [194]y [199]ary [214]. [198]ields"
  28. 120 print"  [154][212]otal [195]ontrol lets you choose the"
  29. 130 print"maximum number of characters to be"
  30. 140 print"entered, and whether or not you want to"
  31. 150 print"accept numbers, letters, or both."
  32. 160 print"[198]irst, you must set [158][204][197] [154]equal to the"
  33. 170 print"maximum number of characters you want"
  34. 180 print"the routine to accept. [212]hen, if you"
  35. 190 print"want the user to be able to enter"
  36. 200 print"numbers, set [158][206][213] [154]equal to 1; and, if you"
  37. 210 print"want the user to be able to enter"
  38. 220 print"letters, set [158][193][204] [154]equal to 1. [212]hen all"
  39. 230 print"you need to do is [158][199][207][211][213][194] 40[154]."
  40. 250 print"[212]he following is an example of what"
  41. 260 print"the [194][193][211][201][195] code and the output would"
  42. 270 print"look like:"
  43. 280 print"  [204][197]=20:[206][213]=0:[193][204]=1:[199][207][211][213][194]40"
  44. 285 print"[159][217]ou can only enter letters."
  45. 290 le=20:nu=.:al=1:gosub40
  46. 300 print"[145][145][145][145][145]";:fora=1to5:print"                                      ":next
  47. 310 print"[145][145][145][145][145][145]"
  48. 320 print"  [204][197]=13:[206][213]=1:[193][204]=0:[199][207][211][213][194]40"
  49. 325 print"[159][217]ou can only enter numbers."
  50. 330 le=13:nu=1:al=0:gosub40
  51. 340 print"[145][145][145][145][145]";:fora=1to5:print"                                      ":next
  52. 350 print"[145][145][145][145][145][145]"
  53. 360 print"  [204][197]=34:[206][213]=1:[193][204]=1:[199][207][211][213][194]40"
  54. 370 print"[159][217]ou can numbers or letters."
  55. 380 le=34:nu=1:al=1:gosub40
  56. 390 print"[145][145][145][145][145]";:fora=1to5:print"                                      ":next
  57. 400 print"[145][145][145][145][145][145]"
  58. 410 print"  [208]ress [[211][208][193][195][197]] to see demo again"
  59. 420 print"  or [[210][197][212][213][210][206]] to return to [204][207][193][196][211][212][193][210]":poke198,.
  60. 430 a=peek(203):ifa<>1anda<>60then430
  61. 440 ifa=60then100
  62. 450 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  63. 460 ifer<>63thenend
  64. 470 load"hello connect",8
  65. 60100 poke53280,10:poke53281,10
  66. 60110 print"[147][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]";
  67. 60120 fora=1to23:print"[221]"spc(38)"[221]";:next
  68. 60130 print"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][157][148][192]"
  69. 60135 fora=217to242:pokea,peek(a)or128:next
  70. 60140 print"         [204][207][193][196][211][212][193][210] [208]resents:"
  71. 60150 print"        [158]                     "
  72. 60160 print"        [158]    [212]otal [195]ontrol     "
  73. 60170 print"        [158]                      "
  74. 60180 print"        [158]  [194]y [199]ary [214]. [198]ields   "
  75. 60190 print"        [158]                      "
  76. 60200 print"        [158]  ([195])opyright  1987   "
  77. 60210 print"        [158]                      "
  78. 60220 print"                              "
  79. 60230 print"        [208]ress [211][208][193][195][197] to continue.":poke198,.
  80. 60240 ifpeek(203)<>60then60240
  81. 60250 return
  82.